#include "newcameradialog.h"
#include "ui_newcameradialog.h"

NewCameraDialog::NewCameraDialog(CAMERA &c, QWidget *parent)
    : QDialog(parent)
    , ui(new Ui::NewCameraDialog)
    , camera(c)
{
    ui->setupUi(this);

    connect(ui->buttonBox, &QDialogButtonBox::accepted, this, &NewCameraDialog::Accept);
}

NewCameraDialog::~NewCameraDialog()
{
    delete ui;
}

void NewCameraDialog::Accept()
{
    camera.name = ui->lineEditCameraName->text();
    camera.MAC = ui->lineEditCameraMAC->text();
    camera.IP = ui->lineEditCameraIP->text();
    camera.numbers = ui->lineEditCameraNumbers->text().split(",");
}
